<template>
    <div>
      <div style="padding: 5px 10px">
        <h3>相关材料信息:</h3>
        <table class="bs-table">
          <tr class="bs-table_row">
            <th class="bs-table_th" width="300px">文件名称</th>
            <th class="bs-table_th" width="300px">内容</th>
            <th class="bs-table_th">上传人</th>
            <th class="bs-table_th">上传时间</th>
            <th class="bs-table_th">操作</th>
          </tr>
          <tr class="bs-table_row" v-for="(file,index) in detaildata.fileList" :key="index">
            <th class="bs-table_td">{{file.fileFullName}}</th>
            <th class="bs-table_td"></th>
            <th class="bs-table_td">{{file.uploadNickname}}</th>
            <th class="bs-table_td">{{file.uploadTime}}</th>
            <th class="bs-table_td">
              <el-link :href="'/planning/file/download/'+file.fileId">下载</el-link>
            </th>
          </tr>
          <tr class="bs-table_row" v-if="!detaildata.fileList || detaildata.fileList.length==0">
            <th class="bs-table_td"  colspan="5">
              暂无数据
            </th>
          </tr>
        </table>
      </div>
      <div style="padding: 5px 10px">
        <h3>规划文本信息:</h3>
        <table class="bs-table">
          <tr class="bs-table_row">
            <th class="bs-table_th" width="600px">文件名称</th>
            <th class="bs-table_th">上传人</th>
            <th class="bs-table_th">上传时间</th>
            <th class="bs-table_th">操作</th>
          </tr>
          <tr class="bs-table_row"  v-for="(makeTxt,index) in detaildata.makeTxtFileList" :key="index">
            <th class="bs-table_td">{{makeTxt.fileName}}</th>
            <th class="bs-table_td">{{makeTxt.uploadNickname}}</th>
            <th class="bs-table_td">{{makeTxt.uploadTime}}</th>
            <th class="bs-table_td">
              <el-link :href="'/planning/file/download/'+makeTxt.fileId">下载</el-link>
            </th>
          </tr>
          <tr class="bs-table_row" v-if="!detaildata.makeTxtFileList || detaildata.makeTxtFileList.length==0">
            <th class="bs-table_td"  colspan="4">
              暂无数据
            </th>
          </tr>
        </table>
      </div>
      <div style="padding: 5px 10px">
        <h3>评审意见信息:</h3>
        <div v-for="(item,index) in expertList" :key="index" v-if="expertList.length!=0">
          <table class="bs-table" style="margin-bottom: 40px">
            <tr class="bs-table_row" style="width: 100%;">
              <th class="bs-table_th" width="200px">专家组长</th>
              <td class="bs-table_td" colspan="5">{{item.expertLeader}}</td>
            </tr>
            <tr class="bs-table_row">
              <th class="bs-table_th">专家组成员名单</th>
              <td class="bs-table_td" colspan="5">{{item.expertList}}</td>
            </tr>
            <tr class="bs-table_row">
              <th class="bs-table_th">评审时间</th>
              <td class="bs-table_td" colspan="5">{{item.reviewTime}}</td>
            </tr>
            <tr class="bs-table_row">
              <th class="bs-table_th">评审结论</th>
              <td class="bs-table_td" colspan="5">{{item.conclusion}}</td>
            </tr>
            <tr class="bs-table_row">
              <th class="bs-table_th">评审报告</th>
              <td class="bs-table_td" colspan="5">
                <div v-for="fileid in item.reportFileIds" :key="fileid">
                  <preview :attachementId="fileid" v-if="fileid"></preview>
                </div>
              </td>
            </tr>
            <tr class="bs-table_row">
              <th class="bs-table_th">其他附件</th>
              <td class="bs-table_td" colspan="5">
                <div v-for="fileid in item.fileIds" :key="fileid">
                  <preview :attachementId="fileid" v-if="fileid"></preview>
                </div>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>
</template>

<script>
  import {getMakeDetail} from "@/api/achievement";

  export default {
    name: "subjectDetail",
    props: {
      id:Number
    },
    created() {
      this.getMakeDetailData();
    },
    computed: {

    },
    data() {
      return {
        detaildata:{},
        expertList:[],
      }
    },
    methods: {
      getMakeDetailData(){
        getMakeDetail(this.id).then(response => {
          if (response.data.code == 0) {
            if(response.data.data && response.data.data.makeDetail){
              this.detaildata  = response.data.data.makeDetail;
            }

            if(response.data.data && response.data.data.expertList){
              this.expertList  = response.data.data.expertList;
            }

          }
        });
      }
    }
  }
</script>

<style ang="scss" scoped>

</style>
